<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
	var arr = [["朝阳","大兴","海淀"],["秦皇岛","唐山","石家庄"],["青岛","济南","淄博","烟台"]];
	
	
	function changefn(){		
	s2.innerHTML ="<option>请选择</option>"
		//获取s1里边的所有值
		var citys = arr[s1.value];
		//遍历数组里每一个城市名
		//创建option元素 把城市名放进去
		//把创建的option添加到s2里面
		//
		for(var i =0;i<citys.length;i++){
			s2.innerHTML += "<option>"+citys[i]+"</option>"
		}
	}
</script>
</head>
<body>
	<select id="s1" onchange="changefn()">
		<option>请选择</option>
		<option value="0">北京</option>
		<option value="1">河北</option>
		<option value="2">山东</option>	
	</select>
	<select id="s2">
		<option>请选择</option>
	</select>
</body>
</html>